package app;

import app.v1.schedulers.AutoStatisticsSalesOrderDetailsScheduler;
import com.gitee.feizns.quickstart.spring.AppUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.time.LocalDate;

/**
 * 应用程序
 * @author feizns
 * @since 2023/07/12
 */
@EnableScheduling
//@EnableRestfulApi
@SpringBootApplication
@RequiredArgsConstructor
public class Application implements WebMvcConfigurer {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
//        test();
    }

    public static void test() {
        //操作前，请先确认连接的数据库
        ////统计昨天发货的数据
        AppUtils.getBean(AutoStatisticsSalesOrderDetailsScheduler.class)
                .statisticsSalesOrderDetails(
                        LocalDate.of(2023, 1, 1),
                        LocalDate.of(2023, 1, 25)
                );
        System.out.println("统计完成");
        System.out.println("统计完成");
        System.out.println("统计完成");
        System.out.println("统计完成");
    }

}
